from pickle import TUPLE1


tpl1="""
execute if score @s advm_battery_swapper_available matches -1 if data entity @s Inventory[{{Slot:{id}b}}].tag.battery store result score @s advm_battery_swapper_temp1 run data get entity @s Inventory[{{Slot:{id}b}}].tag.battery
execute if score @s advm_battery_swapper_temp1 matches 1 if data entity @s Inventory[{{Slot:{id}b}}].tag.battery run scoreboard players set @s advm_battery_swapper_available {id}
"""

with open("gen.txt","w+") as f:
    for i in range(0,36):
        f.write(tpl1.format(id=str(i)))